<?php
use yii\helpers\Url;

$web = Url::base();

?>

<script type="application/javascript">
    var detailPage = 1;
    var totalPage = 1;

    $(function ($) {
        user_id = "<?=$user_summary['id']?>";
        searchIntegral();
    });
    function searchIntegral(i) {
        loading.show();
        var startTime = $("#startTime").val();
        var endTime = $("#endTime").val();
        var data = {};
        data.user_id = user_id;
        data.startTime = startTime;
        data.endTime = endTime;
        if (i != 1) {
            detailPage = 1;
        }
        data.page = detailPage;
        requestHtml('user-integral-partview', data, true, function (responseHtml) {

            $("#detailTable").html(responseHtml);
            loading.hide();
        });

    }
</script>


<div class="panel panel-default">
    <div class="panel-body">
        <div class="row">
            <div class="col-sm-3" style="text-align:center">
                <?php
                if ($user_summary['header_url'] == '') {
                    $user_summary['header_url'] = $web . "/images/mall-m/head-portrait.png";
                }
                ?>
                <img src="<?= $user_summary['header_url'] ?>" style="width: 80px;height: 80px;">
                <br>
                <?= $user_summary['name'] ?>
                <br>
                <b><?= $user_summary['phone'] ?></b>
                <br>
                <?php if ($user_summary['is_enabled'] == 1) {
                    echo '<span class="label label-success">启用</span>';
                } else {
                    echo '<span class="label label-danger">禁用</span>';
                } ?>

            </div>
            <div class="col-sm-9">
                <b>会员编码：</b><?= $user_summary['code'] ?>
                <br>
                <b>创建时间：</b><?= $user_summary['create_datetime'] ?>
                <br>
                <b>子机构(部门)：</b><?= $user_summary['department_name'] ?>
                <br>
                <b>备&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注：</b><?= $user_summary['remark'] ?>
            </div>


        </div>
    </div>
</div>

<div class="panel">
    <div>
        <label class="control-label col-sm-6">剩余积分：<?= $user_summary['integral'] ?></label>
        <div class="form-group col-lg-4">
            <div class="input-group input-large custom-date-range" data-date-format="yyyy-mm-dd">
                <input type="text" class="form-control dpd1" id="startTime" name="from" placeholder="开始时间">
                <span class="input-group-addon">To</span>
                <input type="text" class="form-control dpd2" id="endTime" name="to" placeholder="结束时间">
            </div>
        </div>
        <div class="form-group col-lg-2">
            <button type="submit" class="btn btn-primary" onclick="searchIntegral()"><i
                    class="fa fa-search"></i> 搜索
            </button>
        </div>
    </div>
    <div class="panel">
        <div class="panel-body" id="detailTable">

        </div>
    </div>
</div>


<script src="<?= $web ?>/js/pickers-init.js"></script>